import request from '@/utils/request'

// 查询解析元素列表
export function page(query) {
  return request({
    url: '/v1/GET/analysis/element/page',
    method: 'get',
    params: query
  })
}

// 获取单个解析元素详情
export function getElement(stcd) {
  return request({
    url: '/v1/GET/analysis/element/'+stcd,
    method: 'get'
  })
}
// 获取系统中所有解析元素
export function getAllElementList(query) {
  return request({
    url: '/v1/GET/analysis/element/list',
    method: 'get',
    params: query
  })
}

// 新增单个解析元素
export function insertElement(data) {
  return request({
    url: '/v1/POST/analysis/element',
    method: 'post',
    data: data
  })
}

// 修改单个解析元素
export function updateElement(data) {
  return request({
    url: '/v1/PUT/analysis/element',
    method: 'put',
    data: data
  })
}
// 初始化配置数据到缓存
export function initCache() {
  return request({
    url: '/v1/POST/analysis/element/cache',
    method: 'POST',
  })
}
// 删除单个解析元素
export function delElement(stcds) {
  return request({
    url: '/v1/DELETE/analysis/element/' + stcds,
    method: 'delete'
  })
}
